﻿using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;
using Castle.Components.Validator;
using MiragePWF.NH.Validation;
using Wolfut.MirageEE.Kernal.Common;
using Wolfut.MirageEE.Domain.CommonUtilities;

namespace Wolfut.MirageEE.Domain.Procurement
{
    [ActiveRecord("PAYMENT_BILLS")]
    public class PaymentBill : PersistentObjectWithGuid
    {
        #region 供应商ID
        private string supplierID;

        [Property("SUPPLIER_ID")]
        [ValidateNonEmpty]
        public virtual string SupplierID
        {
            get
            {
                return supplierID;
            }
            set
            {
                supplierID = value;
            }
        }
        #endregion

        #region 付款单编号
        private string paymentBillCode;

        [Property("PAYMENT_BILL_CODE")]
        [ValidateNonEmpty, ValidateLength(0, 100, "付款单编号超长")]
        public virtual string PaymentBillCode
        {
            get
            {
                return paymentBillCode;
            }
            set
            {
                paymentBillCode = value;
            }
        }
        #endregion

        #region 付款人
        private string payer;

        [Property("PAYER")]
        [ValidateLength(0, 100, "付款人超长")]
        public virtual string Payer
        {
            get
            {
                return payer;
            }
            set
            {
                payer = value;
            }
        }
        #endregion

        #region 备注
        private string remarks;

        [Property("REMARKS")]
        [ValidateLength(0, 2000, "付款人超长")]
        public virtual string Remarks
        {
            get
            {
                return remarks;
            }
            set
            {
                remarks = value;
            }
        }
        #endregion

        #region 付款日期
        private DateTime paymentDate;

        [Property("PAYMENT_DATE")]
        public virtual DateTime PaymentDate
        {
            get
            {
                return paymentDate;
            }
            set
            {
                paymentDate = value;
            }
        }
        #endregion

        #region 币别代码
        private string currencyCode;

        [Property("CURRENCY_CODE")]
        [ValidateNonEmpty,ValidateLength(0, 20, "币别代码超长")]
        public virtual string CurrencyCode
        {
            get
            {
                return currencyCode;
            }
            set
            {
                currencyCode = value;
            }
        }
        #endregion

        #region 预付款及退款账户
        private string imprestRefundmentAccount;

        [Property("IMPREST_REFUNDMENT_ACCOUNT")]
        [ValidateLength(0, 100, "预付款及退款账户超长")]
        public virtual string ImprestRefundmentAccount
        {
            get
            {
                return imprestRefundmentAccount;
            }
            set
            {
                imprestRefundmentAccount = value;
            }
        }
        #endregion

        #region 采购订单ID
        private string purchaseOrderID;

        [Property("PURCHASE_ORDER_ID")]
        [ValidateNonEmpty, ValidateLength(0, 20, "采购订单ID超长")]
        public virtual string PurchaseOrderID
        {
            get
            {
                return purchaseOrderID;
            }
            set
            {
                purchaseOrderID = value;
            }
        }
        #endregion

        #region 采购订单号
        private string purchaseOrderCode;

        [Property("PURCHASE_ORDER_CODE")]
        [ValidateLength(0, 100, "采购订单号超长")]
        public virtual string PurchaseOrderCode
        {
            get
            {
                return purchaseOrderCode;
            }
            set
            {
                purchaseOrderCode = value;
            }
        }
        #endregion

        #region 现金折扣率
        private decimal cashDiscountRate;

        [Property("CASH_DISCOUNT_RATE")]
        public virtual decimal CashDiscountRate
        {
            get
            {
                return cashDiscountRate;
            }
            set
            {
                cashDiscountRate = value;
            }
        }
        #endregion

        #region 凭证号
        private string voucherNumber;

        [Property("VOUCHER_NUMBER")]
        [ValidateLength(0, 100, "凭证号超长")]
        public virtual string VoucherNumber
        {
            get
            {
                return voucherNumber;
            }
            set
            {
                voucherNumber = value;
            }
        }
        #endregion

        #region 制单人
        private string producerBy;

        [Property("PRODUCER_BY")]
        [ValidateLength(0, 40, "制单人超长")]
        public virtual string ProducerBy
        {
            get
            {
                return producerBy;
            }
            set
            {
                producerBy = value;
            }
        }
        #endregion

        #region 是否删除
        [Property("IS_DELETED")]
        [ValidateNonEmpty]
        public virtual bool IsDeleted
        {
            get
            {
                return isDeleted;
            }
            set
            {
                isDeleted = value;
            }
        }
        private bool isDeleted;
        #endregion

    }
}
